<div class="contentBody">

    <div class="left">
    <br/>
<h2><u>Maintain Course</u></h2>
<br/>
<a href="<?php echo site_url('maintain_course/insertdetail') ?>"id="add" onmouseover="this.style.color='#1569C7'" onmouseout="this.style.color='#FF8040'" style="color:#FF8040">Create a New Course</a>

<!--Search for course-->
<form id="searchForm" name="searchform" action="<?php echo site_url('maintain_course/search') ?>" method="POST">
    <table>
        <tr>
            <th>Search Course</th>
            <td><select name="cate" id="cate">
                    <option value="course_name" >Course</option>
                    <option value="discipline_name" >Discipline</option>
                </select></td>
            <td><input type="text" id="keyword" name="keyword" size="20"></td>
            <td><input name="submitcourseSearch" id="Filter" value="Filter" type="submit"></td>
            
        </tr>
    </table>
</form>
    

    
<!--Search result - Retrieve the data from database and display the result-->
        <?php
        if(isset($_POST['submitcourseSearch'])){
        ?>
        <div id="result" class="left">

<!--            Display the search result-->
                    <form id="insForm" action="<?php echo site_url('maintain_course/delete') ?>" method="post">

                        <div style="margin-left:5px;">
                     <table width="600px" border="1px" id="infoTable" cellspacing="0px">
                     </table>
              <br>
        <input type="button" id="checkAll" name="checkAll" value="Mark All/Un-mark All">
                            <input type="button" name="delcou" id="delcou" value="Delete"
                            onmouseover="this.style.color='#FF8040'; this.style.textDecoration='underline'"
               onmouseout="this.style.color='#1569C7'; this.style.textDecoration='none'">
                            <input type="hidden" id="couurl" value="<?php echo site_url('maintain_course/Delete');?>">
                            
                             
                            </div>

               <label id="keyword"><?php echo "<b style=color:black;>Your Keyword : " . $_POST['keyword'] . "</b>"; ?></label>
              
                        <div style="margin-left:5px; margin-top:40px">
                    <table id="table_ins" class="tablesorter" width="600px" border="1px" id="infoTable" cellspacing="0px">
              <thead>
                        <tr>
                                <th></th>
                                <th width="80px">Course Name</th>
                                <th>Course Description</th>
                                <th>Discipline</th>
                                <th>Edit</th>
                            </tr>
              </thead>
                    <tbody>
                        <?php
                            foreach($cSearch as $row){

                        ?>

                            <tr>
                                 <td><input type="checkbox" name="course_id[]" id="course_id" value="<?php echo $row->course_id; ?>">
                                     </td>
                                <td><?php echo $row->course_name; ?></td>
                                <td><?php echo $row->course_description; ?></td>
                                <td><?php echo $row->discipline_name; ?></td>
                                <td><a href="<?php echo site_url('maintain_course/updatedetail/'.$row->course_id)?>">Edit</a></td>
                            </tr>

                        <?php
                           }
                        ?>
                    </tbody>
             </table>
                            </div>
             </form>
                        <?php
        }else{
                               echo "<h2 align=center>No Result Found</h2>";
                           }
                        ?>

</div>
</div>
</div>
